package com.aat.dxfy.disconf.callback;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.aat.dxfy.disconf.config.RedisConfig;
import com.aat.dxfy.disconf.service.RedisConfigService;
import com.baidu.disconf.client.common.annotations.DisconfUpdateService;
import com.baidu.disconf.client.common.update.IDisconfUpdate;

/**
 * 更新配置时的回调函数
 */
@Service
@DisconfUpdateService(classes = { RedisConfig.class })
public class RedisConfigServiceUpdateCallback implements IDisconfUpdate {

	protected static final Logger LOGGER = LoggerFactory.getLogger(RedisConfigServiceUpdateCallback.class);

	@Autowired
	private RedisConfigService redisConfigService;

	public void reload() throws Exception {
		redisConfigService.changeConfig();
	}

}